package net.xdclass.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author : zhen.xue
 * @date : 2021-05-03 20:23
 */
@Configuration
public class MybatisPlusPageConfig {



    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return mybatisPlusInterceptor;
    }

    /**
     * 旧版本
     * @return
     */
//    @Bean
//    public PaginationInterceptor pageinationInterceptor(){
//        return new PaginationInterceptor();
//    }
}
